﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VentaElectrodomesticos.AsignacionStock;

namespace VentaElectrodomesticos.AbmProducto
{
    public partial class FormElegirProducto : Form
    {
        private FormAsignacionStock form;

        public FormElegirProducto(FormAsignacionStock form)
        {
            InitializeComponent();
            this.form = form;
        }

        public void agregarProducto(String id, String nombre, String categoria)
        {
            this.dataGridView1.Rows.Add(id, nombre, categoria);
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            form.setAnalista((String)this.dataGridView1[0, e.RowIndex].Value,
                             (String)this.dataGridView1[1, e.RowIndex].Value,
                             (String)this.dataGridView1[2, e.RowIndex].Value);
            this.Close();
        }


    }
}
